import axiosApi from '../../AxiosApi.js'

const apiList = {
  classifyProcessList: {
    method: 'get',
    url: `/api/v1/process/classify`
  },
  createProcess: {
    method: 'post',
    url: `/api/v1/process`
  },
  processList: {
    method: 'post',
    url: `/api/v1/process/query`
  },
  updateProcess: {
    method: 'put',
    url: `/api/v1/process`
  },
  deleteProcess: {
    method: 'delete',
    url: `/api/v1/process`
  },
  processDetails: {
    method: 'get',
    url: `/api/v1/process/details`
  },
}
export default {
  cloneProcess(id){
    return axiosApi({
      url: `/api/v1/process/clone/${id}`,
      method: 'GET'
    })
  },
  processDetails (data) {
    return axiosApi({
      ...apiList.processDetails,
      data
    })
  },
  deleteProcess (data) {
    return axiosApi({
      ...apiList.deleteProcess,
      data
    })
  },
  updateProcess (data) {
    return axiosApi({
      ...apiList.updateProcess,
      data
    })
  },
  processList (data) {
    return axiosApi({
      ...apiList.processList,
      data
    })
  },
  createProcess (data) {
    return axiosApi({
      ...apiList.createProcess,
      data
    })
  },
  getProcessClassify (data) {
    return axiosApi({
      ...apiList.classifyProcessList,
      data
    })
  },
}


//
// // 克隆流程
// export function cloneProcess(id) {
//   return request({
//     url: `/api/v1/process/clone/${id}`,
//     method: 'post'
//   })
// }
